import {
  defineStore
} from 'pinia'
const sys = defineStore({
  id: 'sys',
  state: () => ({
    theme: '#23594B', // 主题,
    mode: 'light', // 明亮模式、暗黑模式（暂未支持）
    modeAuto: false, // 跟随系统
    fontSize: 2 ,// 设置默认字号等级(0-4)
		lang:'tw' // 语言 tw 繁体
  }),
  getters: {},
  actions: {
		setLang() {
			if(this.lang === 'cn'){
				this.lang = 'tw'
			}else{
				this.lang = 'cn'
			}
		},
    setTheme(theme = '') {
      // if (theme === '') {
      //   const theme = '#006400'
      //   this.theme = theme
      // } else {
      //   this.theme = theme
      // }
    }
  },
  persist: {
    enabled: true,
    strategies: [{
      key: 'sys-store'
    }]
  }
})

export default sys
